const bcryptjs = require("bcryptjs")

// 登录
const {login,register,verify,getStores} = require("../dao/storesDao");
module.exports.login = async function (user){
    const data = await login({username:user.username})
    if(data.length>0){
        // console.log(user.password,data[0].password)
        // const isok = bcryptjs.compareSync(user.password,data[0].password)
        return true
    }
    return false
    
};
module.exports.register = async function (user){
    const data = await register(user)
    if(data.length>0){
        return true
    }
    return false
}
module.exports.verify = async function (user){
    const data = await verify(user)
    console.log(data)
    if(data.length>0){
        return true
    }
    return false
}

module.exports.getStores=async function (){
    return await getStores()
}